import Cookies from 'js-cookie';

export default class Session {
  static set(name, value) {
    return Cookies.set('admin:' + name, value);

  }

  static get(name) {
    let value = Cookies.get('admin:' + name);
    return value === undefined ? value : JSON.parse(value);
  }

  static has(name) {
    let value = Cookies.get('admin:' + name);
    return value !== undefined;
  }

  static del(name) {
    return Cookies.remove('admin:' + name);
  }
}
